; 大小写转换
assume cs:code, ds:data, ss:stack


; A     0100 0001        0100 0001
;  and  0010 0000   or   0010 0000 转换成小写
;       0000 0000        0110 0001
;
;
; a     0101 0111       0110 0001
;  and  1101 1111  or   0010 0000 转换成小写
;       0101 1001       0110 0001


data segment
    db 'Basic Me' ; 将其变成大写    
                                ;存放在栈中
    db 'What is Your Name' ; 将其变成小写
data ends

stack segment stack
    dw 0,0,0,0
    dw 0,0,0,0
    dw 0,0,0,0
    dw 0,0,0,0
stack ends

code segment

start:
    mov ax, data

    mov ds, ax

    mov ax, stack

    mov ss, ax

    mov sp, 32

    mov ax, 0

    mov bx, 0

    mov cx, 8

covert:
    mov al, ds:[bx]

    or al,  00100000B; 转换成小写

    mov ss:[bx], al

    mov al, ds:[bx + 8]

    and al, 11011111B; 转换成大写

    mov ss:[bx+8], al

    inc bx

    loop  covert

    mov ax, 4c00H

    int 21H

code ends

end start

